import requests from '../request';
//将产品添加到购物车中（获取更新某一个产品的个数）
///api/cart/addToCart/{ skuId }/{ skuNum }  POST
export const reqAddOrUpdateShopCart = (skuId,skuNum)=>requests({
  url:`/cart/addToCart/${skuId}/${skuNum}`,
  method:'POST'
})
// 获取购物车列表 /api/cart/cartList
export const reqCartList = ()=>requests({
  url:`/cart/cartList`,
  method:'GET'
})
// 切换商品选中状态 /api/cart/checkCart/{skuID}/{isChecked} GET 商品ID 商品选中状态 
// 0代表取消选中
// 1代表选中
export const reqCheckCart = (skuID,isChecked)=>requests({
  url:`/cart/checkCart/${skuID}/${isChecked}`,
  method:'GET'
})
// 删除购物车商品/api/cart/deleteCart/{skuId} 商品id
export const reqDeleteCart = (skuId)=>requests({
  url:`/cart/deleteCart/${skuId}`,
  method:'DELETE'
})